﻿using System;

namespace OpenWaves.EPiServer.GenericListProperty
{
    public class  ImageListWidgetAttribute : Attribute, IListItemWidget
    {
        public const string ClientClass = "ow-epi-listProperty.widgets.specialized.ImageListPropertyWidget";

        public string ImageUrlPropertyName { get; set; }

        public string ImageTitlePropertyName { get; set; }

        public object PropertyValue { set; get; }

        public string WidgetClass {
            get { return ClientClass; }
        }

        public object WidgetSettings
        {
            get
            {
                return new
                    {
                        ImageUrlPropertyName = this.ImageUrlPropertyName.ToJavascriptPropertyName(),
                        ImageTitlePropertyName = this.ImageTitlePropertyName.ToJavascriptPropertyName()
                    };
                return null;
            }
        }
    }
}